# Contributor: Dmitry Zakharchenko <dmitz@disroot.org>
# Maintainer: Dmitry Zakharchenko <dmitz@disroot.org>
pkgname=pdfcpu
pkgver=0.7.0
pkgrel=1
pkgdesc="PDF processor written in Go"
url="https://pdfcpu.io"
arch="all"
license="Apache-2.0"
makedepends="go"
options="!check" # test suite fails
source="$pkgname-$pkgver.tar.gz::https://github.com/pdfcpu/pdfcpu/archive/v$pkgver.tar.gz"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -o bin/pdfcpu ./cmd/...
}

check() {
	go test ./...
}

package() {
	install -Dm755 bin/pdfcpu "$pkgdir"/usr/bin/pdfcpu
}

sha512sums="
fa58580f2ee8ba128083ead7acf3653182df127304d72c15693b0e48af80b229e44a57f51dc48b59a1483a4ad5181bb4870a28a9e39dd9db652ac0c55c2654ec  pdfcpu-0.7.0.tar.gz
"
